home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / inccbp.c < prev    next >
C/C++ Source or Header  |  1991-07-05  |  934b  |  32 lines

  1. /*****************************************************************************
  2.  
  3.     IncCBp()
  4.  
  5.     This function increments the command buffer pointer CBfPtr.  It
  6. checks whether incrementing the command buffer pointer will move the command
  7. buffer pointer past the end of the command buffer.
  8.  
  9. *****************************************************************************/
  10.  
  11. #include "zport.h"        /* define portability identifiers */
  12. #include "tecoc.h"        /* define general identifiers */
  13. #include "defext.h"        /* define external global variables */
  14. #include "deferr.h"        /* define identifiers for error messages */
  15.  
  16. DEFAULT IncCBP()
  17. {
  18.     if (CBfPtr == CStEnd) {            /* if end of command string */
  19.         if (MStTop < 0) {        /* if not in a macro */
  20.             ErrUTC();        /* unterminated command */
  21.             return FAILURE;
  22.         }
  23.         return SUCCESS;
  24.     }
  25.  
  26.     ++CBfPtr;
  27.     if (TraceM) {                /* if trace mode is on */
  28.         EchoIt(*CBfPtr);        /* display the character */
  29.     }
  30.     return SUCCESS;
  31. }
  32.